package net.xiaoyu233.mitemod.miteite.trans.block;

import net.minecraft.*;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(BlockEnderPortalFrame.class)
public class BlockEndPortalFrameTrans  {

     @Inject(method = "onBlockPlacedMITE",at =@At("HEAD"),cancellable = true)
     public void mITE_ITE_master$checkBossDefeated(World world, int x, int y, int z, int metadata, Entity placer, boolean test_only, CallbackInfoReturnable<Boolean> cir){
         WorldData worldInfo = world.getWorldInfo();
         NBTTagCompound data = worldInfo.getNBTTagCompound();
         if (!data.getBoolean("InfernalOverlordDefeated")) {
             cir.setReturnValue(true); // 取消激活动作
         }
    }
}
